package truef.sao.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;


import edu.zut.cs.software.base.domain.BaseTreeEntity;

@Table(name = "T_SHOPPINGCART")
@Entity
@NamedQueries({ @NamedQuery(name = "ShoppingCart.getRoot", query = "select g from ShoppingCart g where g.parent is null") })
public class ShoppingCart extends BaseTreeEntity<ShoppingCart>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 7073363054324218576L;
	
	@Column(name = "Order")
	@OneToMany(mappedBy = "shoppingcart", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	Set<Order> orders;

}
